﻿<phone:PhoneApplicationPage 
    x:Class="BathroomLocator.Phone.Pages.BathroomLocationDetailsEditPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource ApplicationNameString}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="details" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			
			<ScrollViewer Grid.Row="0" Margin="12, 0, 12, 0">
				<StackPanel>
					<!-- Facility Name -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="Facility Name" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <TextBox x:Name="FacililtyNameTextBox" Text="{Binding Path=BathroomLocation.FacilityName, Mode=TwoWay}" />
					</StackPanel>

					<!-- Street Address -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="Street Address" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <TextBox x:Name="StreetAddressTextBox" Text="{Binding Path=BathroomLocation.AddressLine1, Mode=TwoWay}"/>
					</StackPanel>

					<!-- City -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="City" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <TextBox x:Name="CityTextBox" Text="{Binding Path=BathroomLocation.City, Mode=TwoWay}"/>
					</StackPanel>

					<!-- State -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="State" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <TextBox x:Name="StateTextBox" Text="{Binding Path=BathroomLocation.State, Mode=TwoWay}"/>
					</StackPanel>

					<!-- Zip Code -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="Zip Code" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <TextBox x:Name="ZipCodeTextBox" Text="{Binding Path=BathroomLocation.ZipCode, Mode=TwoWay}" />
					</StackPanel>

					<!-- Rating -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="Rating" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <TextBox x:Name="RatingTextBox" Text="{Binding Path=BathroomLocation.Rating, Mode=TwoWay}" />
                    </StackPanel>

					<!-- Comments -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="Comments" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <TextBox x:Name="CommentTextBox" Text="{Binding Path=BathroomLocation.Comment, Mode=TwoWay}" />
					</StackPanel>

					<!-- Picture -->
					<StackPanel Margin="0, 0, 0, 10">
						<TextBlock Text="Picture" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12, 0, 12, -5"/>
                        <Image x:Name="BathroomImage" HorizontalAlignment="Center" VerticalAlignment="Center"
                               Stretch="Fill" Height="400" Width="400"
                               Source="{Binding Path=BathroomLocation.ImagePath}"/>
					</StackPanel>
				</StackPanel>
			</ScrollViewer>

			<StackPanel Grid.Row="1" Margin="12,0,12,0" Orientation="Vertical" VerticalAlignment="Bottom">
				<TextBlock Height="Auto" HorizontalAlignment="Left" Margin="15,2,0,0" Name="Message" Text="{Binding Message}" TextWrapping="Wrap" />
				<ProgressBar Height="20" IsIndeterminate="True" Visibility="{Binding IsSaving, Converter={StaticResource VisibilityConverter}}" />
			</StackPanel>
		</Grid>
    </Grid>

	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
			<shell:ApplicationBarIconButton IconUri="/Toolkit.Content/appbar.save.rest.png" Text="save" Click="OnSaveData" />
			<shell:ApplicationBarIconButton IconUri="/Toolkit.Content/appbar.delete.rest.png" Text="delete" Click="OnDeleteData"/>
			<shell:ApplicationBarIconButton IconUri="/Toolkit.Content/appbar.feature.camera.rest.png" Text="picture" Click="ApplicationBarIconButton_Click"/>
            
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="take picture" Click="OnApplicationBarMenuItemTakePictureClick"/>
            </shell:ApplicationBar.MenuItems>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>
	
</phone:PhoneApplicationPage>
